<script setup>
import { ref } from 'vue'
import { articleGetChannelService } from '@/api/article'
const channelList = ref([])
const getChannelList = async () => {
    const res = await articleGetChannelService()
    channelList.value = res.data.data
    console.log(channelList.value)
}
getChannelList()
defineProps({
    modelValue: {
        type: [Number, String]
    },
    width: {
        type: String
    }
})
const emit = defineEmits('update:modelValue')
</script>
<template>
    <el-form-item label="文章分类">
        <el-select :style="{ width}" :modelValue="modelValue" @update:modelValue="emit('update:modelValue', $event)">
            <el-option v-for="channel in channelList" :key="channel.id" :label="channel.cate_name" :value="channel.id"></el-option>
        </el-select>
    </el-form-item>
</template>